# list = range(10)
# print(list)
# print(type(list))

# nums = [11, 22, 33, 44, 55]
# i = 0
# while i < len(nums):
#     print(nums[i],end="  ")
#     i += 1

# li1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# for i in range(len(li1)):
#     if li1[i] % 2 == 0:
#         li1[i] += 1
# print(li1)

# str = 'hello world'
# di = {}
# for i in str:
#     if i.isalpha():
#         if i in di:
#             di[i] += 1
#         else:
#             di[i] = 1
# print(di)

# import random
# names = ['A','B','C','D','E','F','G','H']
# offices = [[],[],[]]
# for i in range(len(names)):
#     rand = random.randint(0,2)
#     offices[rand].extend(names[i])
# print(offices)

#
# d = {"a":1,"b":2}
# s = d.update({"a":10})
# print(s)
# print(d)


# info = {'name':'张三'}
# info['name'] = '李四'
# info.clear()
# len(info)
# info.keys()
# info.values()

# person = {"li":18,"wang":50,"zhang":20,"sun":22}
# max = 0
# for v in person.values():
#     if v > max:
#         max = v
# for k in person.keys():
#     if person[k] == max:
#         print(k,':',person[k])

# str = input('请输入一个句子:')
# islow = 0
# isup = 0
# for i in str:
#     if i.isalpha():
#         if i.islower():
#             islow += 1
#         else:
#             isup += 1
# print('大写实例：',isup)
# print('小写实例：',islow)

# c_list = [[x] for x in range(1, 3)]
# print(c_list)

# multiples = [ i for i in range(10) if i % 3 is 0]
# print(multiples)

# d = {k:v for k,v in enumerate("a,b,c,d,e,f".split(','),1)}
# print(d)

# s = "192.168.0.300"
# data = [ v if 0<=int(v)<=255 else False for v in s.split('.') ]
# print(data)

# my_list = [str(i + 3) for i in range(4)]
# print(my_list)
# my_list = ["%d" % (i + 3) for i in range(4)]
# print(my_list)
# my_list = ["%d" % i for i in range(3, 7)]
# print(my_list)
# my_list = [str(i) for i in range(3, 6)]
# print(my_list)

# my_list = [5, 2, 8, 6, 9]
# print(max(my_list))


# my_list = range(1, 10)
# print(type(my_list))
# print(my_list)


# my_list = [5, 2, 8, 6, 9]
# print(2 in my_list)
#
# my_list = [1, 2, 3]
# print(my_list*2)

# li = [1,2,3,4,5]
# print(li.pop())
# print(li)
# print(li.remove(5))
# print(li)
# del li[-1]
# print(li)

# dict_ = {'name':1,'age':23}

# 现在有一个列表li = [1, 1, 3, 2, 5, 6, 4, 8, 6, 4, 9, 8]，请使用程序,去除重复的数字(不能使用set方法)
# li = [1, 1, 3, 2, 5, 6, 4, 8, 6, 4, 9, 8]
# set_ = set()
# for i in li:
#     if i not in set_:
#         set_.add(i)
# print(set_)

# def sum_test(n):
#     sum = 0
#     for i in range(1,n+1):
#         sum += i
#     print(sum)
# sum_test(9)


# 给定一个列表为chars = ['a', 'b', 'c', 'd']，请使用for循环实现带下标索引的遍历，结果为：
# chars = ['a', 'b', 'c', 'd']
# for k,v in enumerate(chars):
#     print(k,v)

#                                                                                                   6hello2pyth3onniha4o
# 现有字符串s = "6hel@#$lo2 pyt \nh3on ni\t ha4o%$"，去掉所有不是字母和数字的字符，打印结果："请理以后的结果为：6hello2pyth3onniha4o"
# s = "6hel@#$lo2 pyt \nh3on ni\t ha4o%$"
# i = 0
# str = ""
# while i < len(s):
#     if s[i].isalpha() or s[i].isdigit():
#         str += s[i]
#     elif s[i] == '\\':
#         i += 1
#     i += 1
# print(str)
#
# s = "helloworldhellopythonhelloc++hellojava"
# list_ = []
# i = 0
# while i < len(s) - 5:
#     j = i
#     flag = True
#     for k in 'hello':
#         if s[j] != k:
#             flag = False
#         else:
#             j += 1
#     if flag:
#         list_.append(i)
#     i += 1
# tuple_ = tuple(list_)
# print(tuple_)


# li = [1,2,4,None,5,None]
# nums = [num for num in li if str(num).isdigit()]
# print(nums)

# 已知字符串s = "aAsmr3idd4bgs7Dlsf9eAF",将字符串中的数字取出，生成一个新的字符串。

# s = "aAsmr3idd4bgs7Dlsf9eAF"
# str = ""
# for i in s:
#     if i.isdigit():
#         str += i
# print(str)


# # 定义一个函数，接受三个参数，分别为字符串s1、字符串s2、字符串s3，判断字符串的长度,如果三个字符串中有一个长度超过6,就进行错误提示，如果没有超过,就返回三个字符串拼接之后的结果
# def string(s1, s2, s3):
#     if len(str(s1)) > 6 or len(str(s2)) > 6 or len(str(s3)) > 6:
#         print("您输入的字符串中，有长度超过6的")
#     else:
#         return str(s1) + str(s2) + str(s3)
#
# print(string(1, 2, 3))
# print(string('1', '2', '3'))

# def add(num1,num2):
#     return num1 + num2
# def sub(num1, num2):
#     return num1 - num2
# def mul(num1, num2):
#     return num1 * num2
# def div(num1, num2):
#     return num1 / num2
# print(add(4, 2))
# print(sub(4, 2))
# print(mul(4, 2))
# print(div(4, 2))


# # 函数一
# def func1():
#    i = 1
#    sum = 0
#    while i<=100:
#       sum += i
#       i += 1
#    return sum
# # 函数二
# def func2(n):
#    i = n
#    sum = 0
#    while i <=100:
#       sum += i
#       i += 1
#    return sum
# # 函数三
# def func3(n=1, m=100):
#    i = n
#    sum = 0
#    while i <= m:
#       sum += i
#       i += 1
#    return sum
#
# print(func1())
# print(func2(2))
# print(func3(50,100))

# di = {'name':1,'age':2}
# di[::-1]
# print(di)

# print(max(di))
# tu = (2,3,4,5)
# for i in tu:
#     print(i)

my_list = [1, 2, 3]
print(my_list*2)